package com.hjh.testdemo.ui.home

import androidx.navigation.fragment.findNavController
import com.hjh.testdemo.R
import com.hjh.testdemo.databinding.FragmentHomeBinding
import com.hjh.core.activity.BaseFragment
import com.hjh.tool.extension.gone
import com.hjh.tool.extension.visible

/**
 * @author： hjh
 * @createDate： 2025/6/4 17:36
 * @description： 首页
 * @qq： 3472903821
 * @version: 1.0
 */
class HomeFragment : BaseFragment<FragmentHomeBinding>() {

    override fun initView() {
        isTopFragment()
        binding.btnCameraTest.gone()
        binding.btnAudioTest.gone()
        binding.btnDeviceInfo.gone()
        binding.btnUsbHost.gone()
        binding.btnUsbAccessory.visible()
        binding.btnSensorTest.gone()
        binding.btnNetworkTest.gone()
        binding.btnStorageTest.gone()
        binding.btnGpsTest.gone()
        binding.btnScreenTest.gone()
    }

    override fun initListener() {
        // 摄像头测试
        binding.btnCameraTest.setOnClickListener {
            findNavController().navigate(R.id.cameraRecordFragment)
        }

        // 音频测试
        binding.btnAudioTest.setOnClickListener {
            findNavController().navigate(R.id.audioPlayerFragment)
        }

        // 设备信息
        binding.btnDeviceInfo.setOnClickListener {
            findNavController().navigate(R.id.deviceInfoFragment)
        }

        binding.btnUsbHost.setOnClickListener {
            findNavController().navigate(R.id.usbHostFragment)
        }

        binding.btnUsbAccessory.setOnClickListener {
            // findNavController().navigate(R.id.usbAccessoryFragment)
            findNavController().navigate(R.id.usbTestFileFragment)
        }

        // 传感器测试
        binding.btnSensorTest.setOnClickListener {
        }

        // 网络测试
        binding.btnNetworkTest.setOnClickListener {
        }

        // 存储测试
        binding.btnStorageTest.setOnClickListener {
        }

        // GPS测试
        binding.btnGpsTest.setOnClickListener {
        }


        // 屏幕测试
        binding.btnScreenTest.setOnClickListener {
        }

    }
}